<script setup lang="ts">
// import { ref } from 'vue'

import { useLLMStore } from '../stores/llm'
import { useIconsStore } from '../stores/icons';
import { Llm_id ,changeIcon, changeLLM, changeList} from '../utils/utils';
import { useListStore } from '../stores/list'
import { useStatusStore } from '../stores/status';

const llm = useLLMStore()
const icons = useIconsStore()
const lists = useListStore()
const status = useStatusStore()

// const height = ref('')

function change(llm_id: Llm_id) {
    changeList(llm_id, (llm_id) => {
        lists.changeCurrentList(llm_id)
    })
    changeIcon(llm_id, (llm_id) => {
        icons.changeIcons(llm_id)
    })
    changeLLM(llm_id, (llm_id) => {
        llm.change(llm_id)
        status.changeLlmId(llm_id)
    })
}
function setCurrentIcon() {
  if (llm.llm == 'doubao') change(Llm_id.doubao)
  else if (llm.llm == 'gemini') change(Llm_id.gemini)
  else if (llm.llm == 'glm') change(Llm_id.glm)
  else if (llm.llm == 'spark') change(Llm_id.spark)
  else if (llm.llm == 'qwen') change(Llm_id.qwen)
  else if (llm.llm == 'yiyan') change(Llm_id.yiyan)
}
setCurrentIcon()
function clickHandler(llm_target: Llm_id) {
  console.log("llm", llm_target);
  llm.change(llm_target)
  setCurrentIcon()
}
// function getWindowHeight() {
//   height.value = '{ height:' + (window.innerHeight - 20) + 'px;}'
//   console.log(height.value)

// }
// getWindowHeight()
</script>

<template>
  
  <v-speed-dial transition="fade-transition" >
    <template v-slot:activator="{ props: activatorProps }">
      <v-fab v-bind="activatorProps" size="large" :icon=icons.icons></v-fab>
    </template>
    <v-btn key="1" icon="mdi-alpha-d-box" @click="clickHandler(Llm_id.doubao)"></v-btn>
    <v-btn key="2" icon="mdi-alpha-s-box" @click="clickHandler(Llm_id.spark)"></v-btn>
    <v-btn key="3" icon="mdi-alpha-q-box" @click="clickHandler(Llm_id.qwen)"></v-btn>
    <v-btn key="4" icon="mdi-alpha-y-box" @click="clickHandler(Llm_id.yiyan)"></v-btn>
    <v-btn key="5" icon="mdi-alpha-g-box" @click="clickHandler(Llm_id.glm)"></v-btn>
    <v-btn key="6" icon="mdi-google" @click="clickHandler(Llm_id.gemini)"></v-btn>

  </v-speed-dial>
</template>

<!-- <style scoped>


</style> -->
